﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.EquipmentManagement;

namespace Digitalmes.Model.EquipmentManagement
{
    /// <summary>
    /// 设备报警项
    /// </summary>
	[Table("EquipmentAlarmItem")]

    [Display(Name = "_Model.EquipmentAlarmItem")]
    public class EquipmentAlarmItem : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._EquipmentAlarmItem._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }


        [Display(Name = "_Model._EquipAlarmRecord._Equipment")]
        [Comment("设备")]
        public Equipment Equipment { get; set; }
        [Display(Name = "_Model._EquipAlarmRecord._Equipment")]
        [Comment("设备")]
        public long? EquipmentId { get; set; }

        [Display(Name = "_Model._EquipmentAlarmItem._EquipName")]
        [Comment("设备名称")]
        public string EquipName { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._EquipTag")]
        [Comment("变量")]
        public EquipmentTag EquipTag { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._EquipTag")]
        [Comment("变量")]
        public long? EquipTagId { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Level")]
        [Comment("报警级别")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public AlarmLevelEnum? Level { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._EquipTagName")]
        [Comment("变量名称")]
       
        public string EquipTagName { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._EquipTagAddress")]
        [Comment("变量地址")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string EquipTagAddress { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Classify")]
        [Comment("报警分类")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public AlarmTypeEnum? Classify { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Content")]
        [Comment("报警内容")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Content { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Bits")]
        [Comment("位")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public int? Bits { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Active")]
        [Comment("激活")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool? Active { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Aux_1")]
        [Comment("备用1")]
        public string Aux_1 { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._Aux_2")]
        [Comment("备用2")]
        public string Aux_2 { get; set; }
        [Display(Name = "_Model._EquipmentAlarmItem._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
